package com.platform.enums.converters;


import com.platform.enums.ConfValueMode;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

/**
 * @author coder
 */
@Converter
public class ConfValueModeConverter implements AttributeConverter<ConfValueMode, String> {

    @Override
    public String convertToDatabaseColumn(ConfValueMode attribute) {
        return attribute.getValue();
    }

    @Override
    public ConfValueMode convertToEntityAttribute(String value) {
        return ConfValueMode.getByValue(value);
    }
}
